package com.m3839.sdk.login.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.m3839.sdk.common.core.Constant;

/**
 * Description:HykbTip
 *
 * @author 陈宝阳
 * @create 2020/8/7 16:13
 */
public class InternalTip implements Parcelable {

  /**
   * 封号或者下载
   */
  public String tipContent;

  public String negativeBtnName;

  public int negativeBtnAction;

  public String positiveBtnName;

  public int positiveBtnAction;

  public InternalTip(){}

  protected InternalTip(Parcel in) {
    tipContent = in.readString();
    negativeBtnName = in.readString();
    negativeBtnAction = in.readInt();
    positiveBtnName = in.readString();
    positiveBtnAction = in.readInt();
  }

  public static final Creator<InternalTip> CREATOR = new Creator<InternalTip>() {
    @Override
    public InternalTip createFromParcel(Parcel in) {
      return new InternalTip(in);
    }

    @Override
    public InternalTip[] newArray(int size) {
      return new InternalTip[size];
    }
  };

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(tipContent);
    dest.writeString(negativeBtnName);
    dest.writeInt(negativeBtnAction);
    dest.writeString(positiveBtnName);
    dest.writeInt(positiveBtnAction);
  }

  /**
   * 通用的切换账号弹窗的文案内容格式
   * @param content
   * @return
   */
  public static InternalTip getSwitchAccountTip(String content) {
    final InternalTip tip = new InternalTip();
    tip.tipContent = content;
    tip.negativeBtnName = Constant.HYKB_STRING_EXIT_GAME;
    tip.negativeBtnAction = Constant.HYKB_ACTION_TIP_NEGATIVE_EXIT_GAME;
    tip.positiveBtnName = Constant.HYKB_STRING_SWITCH_ACCOUNT;
    tip.positiveBtnAction = Constant.HYKB_ACTION_TIP_POSITIVE_SWITCH_ACCOUNT;
    return tip;
  }

  /**
   * 通用的账号重登弹窗的文案内容格式
   * @param content
   * @return
   */
  public static InternalTip getLoginAgainTip(String content) {
    final InternalTip tip = new InternalTip();
    tip.tipContent = content;
    tip.negativeBtnName = Constant.HYKB_STRING_EXIT_GAME;
    tip.negativeBtnAction = Constant.HYKB_ACTION_TIP_NEGATIVE_EXIT_GAME;
    tip.positiveBtnName = Constant.HYKB_STRING_LOGIN_AGAIN;
    tip.positiveBtnAction = Constant.HYKB_ACTION_TIP_POSITIVE_LOGIN_AGAIN;
    return tip;
  }


}
